package com.xiangyueEducation.uploaderCloud.mapper.mapperUtil;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiangyueEducation.uploaderCloud.mapper.UserMapper;
import com.xiangyueEducation.uploaderCloud.pojo.entity.User;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

@Component
public class UserMapperUtil {
    @Resource
    UserMapper userMapper;
    public User selectByUsername(String number){
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("number",number);
        return userMapper.selectOne(wrapper);
    }


    public User selectByEmail(String email){
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.eq("email",email);
        return userMapper.selectOne(wrapper);
    }
}
